package com.example.lottery.service.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;


@Getter
@AllArgsConstructor
public enum UserIdentityEnum {
    ADMIN("管理员"),
    NORMAL("普通用户");

    private final String msg;

    /**
     * 判断content字符串是否为枚举实例名
     * @param content
     * @return 返回枚举实例
     */
    public static UserIdentityEnum forName(String content){
        UserIdentityEnum[] values = UserIdentityEnum.values();
        for (UserIdentityEnum userIdentityEnum:values) {
            if(userIdentityEnum.name().equalsIgnoreCase(content)){
                return userIdentityEnum;
            }
        }
        return null;
    }

}
